﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="p_tcdc_mst_information_group.aspx.cs" Inherits="TCDC_System.Content.MasterData.p_tcdc_mst_information_group" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register TagPrefix="uc" Src="~/UserControl/InformationGroupAdd.ascx" TagName="InformationGroupAdd" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <script type="text/javascript">
        var exportData = function (GridData, GridPanel) {
            GridData.setValue(Ext.encode(GridPanel.getRowsValues({ selectedOnly: false })));
        };
     </script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="mainResource" runat="server" CleanResourceUrl="false" />
<ext:Hidden ID="GridData" runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="border">
<Items>
<ext:GridPanel ID="GridPanelInformationGroup" runat="server" Region="Center" DDGroup="gridDDGroup" 
     EnableDragDrop="false" StripeRows="true"  Title="InformationGroup" 
     Icon="Vcard" Frame="true">
     <TopBar>
          <ext:Toolbar ID="Toolbar1" runat="server">
               <Items>
                    <ext:Button ID="btAdd" runat="server" Text="Add" Icon="Add" OnDirectClick="AddInformationGroup"/>
                    <ext:ToolbarSeparator/>
                    <ext:Button ID="btDelete" runat="server" Text="Delete" Icon="Delete">
                         <DirectEvents>
                              <Click OnEvent="DeleteInformationGroup" > 
                              <EventMask ShowMask="true"/>
                              </Click>
                         </DirectEvents>
                    </ext:Button>
                    <ext:ToolbarSeparator/>
                    <ext:ToolbarFill ID="ToolbarFill1" runat="server"/>
                    <ext:Button ID="btExcel" runat="server" AutoPostBack="true" OnClick="ExportExcelInformationGroup" Text="To Excel" Icon="PageExcel">
                         <Listeners>
                              <Click Handler="exportData(#{GridData},#{GridPanelInformationGroup});"/>
                         </Listeners>
                    </ext:Button>
               </Items>
          </ext:Toolbar>
     </TopBar>
     <Store>
          <ext:Store runat="server" ID="StoreInformationGroup" OnRefreshData="StoreInformationGroup_Refresh"> 
               <Reader>
                    <ext:JsonReader IDProperty="information_group_id">
                         <Fields>
                              <ext:RecordField Name="information_group_id"/>
                              <ext:RecordField Name="information_group_desc"/>
                              <ext:RecordField Name="object_type"/>
                              <ext:RecordField Name="sorting_group_no"/>
                         </Fields>
                    </ext:JsonReader>
               </Reader>
          </ext:Store>
     </Store>
     <ColumnModel>
          <Columns>
               <ext:RowNumbererColumn/>
               <ext:Column Header="information_group_id" DataIndex="information_group_id" Width="100" Align="Center"/>
               <ext:Column Header="information_group_desc" DataIndex="information_group_desc" Width="250" >
                    <Editor>
                         <ext:TextField ID="TextField1" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="object_type" DataIndex="object_type" Width="100" >
                    <Editor>
                         <ext:TextField ID="TextField2" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
               <ext:Column Header="sorting_group_no" DataIndex="sorting_group_no" Width="100" Align="Center">
                    <Editor>
                         <ext:NumberField ID="TextField3" runat="server" AllowBlank="false" MsgTarget="Side"/>
                    </Editor>
               </ext:Column>
          </Columns>
     </ColumnModel>
     <Plugins>
          <ext:GridFilters ID="GridFilters1" runat="server" Local="true">
               <Filters>
                    <ext:StringFilter DataIndex="information_group_id" />
                    <ext:StringFilter DataIndex="information_group_desc" />
                    <ext:StringFilter DataIndex="object_type" />
                    <ext:StringFilter DataIndex="sorting_group_no" />
               </Filters>
          </ext:GridFilters>
          <ext:RowEditor ID="RowEditorInformationGroup" runat="server" SaveText="Update">
               <DirectEvents>
                    <AfterEdit OnEvent="UpdateInformationGroup">
                         <ExtraParams>
                              <ext:Parameter Name="InformationGroupValue" Value="Ext.encode(#{GridPanelInformationGroup}.getRowsValues({selectedOnly:true}))" Mode="Raw">
                              </ext:Parameter>
                         </ExtraParams>
                         <EventMask ShowMask="true"/>
                    </AfterEdit>
               </DirectEvents>
          </ext:RowEditor>
     </Plugins>
     <SelectionModel>
          <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
     </SelectionModel>
     <LoadMask ShowMask="true" />
     <BottomBar>
          <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="19" DisplayInfo="true" 
              EmptyMsg="No Request to display"/>
     </BottomBar>
</ext:GridPanel>

<ext:Panel ID="PanelSouth" runat="server" Region="South" Split="true" Height="30" Padding="6" Html="" BodyStyle="background-color: #DFE8F6" />
</Items>
</ext:Viewport>
<uc:InformationGroupAdd ID="InformationGroupAdd1" runat="server" />

</form>
</body>
</html>

